package com.azt.data.action;

import com.azt.data.permission.MenuPermission;
import com.azt.provider.mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * Created by zouheyuan on 2017/5/3.
 */
@Controller
@RequestMapping(value = "/category")
public class CategoryAction extends BaseAction{


    @Autowired
    private CategoryMapper categoryMapper;


    @MenuPermission
    @RequestMapping(value = "/overview")
    public String overview() {
        return "category/overview";
    }


    @RequestMapping("/orderData")
    @ResponseBody
    public List<Map<String, Object>> getCategoryOrderData() {
        return categoryMapper.getCategoryOrderData();
    }

    @RequestMapping("/categoryCustNum")
    @ResponseBody
    public List<Map<String, Object>> getCategoryCustNum() {
        return categoryMapper.getCategoryCustNum();
    }

    @RequestMapping("/enquiryData")
    @ResponseBody
    public List<Map<String, Object>> getCategoryEnquiryData() {
        return categoryMapper.getCategoryEnquiryData();
    }

    @RequestMapping("/orderPurData")
    @ResponseBody
    public List<Map<String, Object>> getCategoryPurData() {
        return categoryMapper.getPurData();
    }

    @RequestMapping("/productData")
    @ResponseBody
    public List<Map<String, Object>> getCategoryProductData() {
        return categoryMapper.getCategoryProductData();
    }

}
